import request from '@/utils/request'

// 查询部门列表
export function listDept() {
  return request({
    url: '/system/dept/list',
    method: 'get'
  })
}

// 查询部门列表（排除节点）
export function listDeptExcludeChild(deptId) {
  return request({
    url: '/system/dept/list/exclude/' + deptId,
    method: 'get'
  })
}

// 查询部门详细
export function getDept(deptId) {
  return request({
    url: '/system/dept/' + deptId,
    method: 'get'
  })
}

// 新增部门
export function saveDept(data) {
  return request({
    url: '/system/dept/saveDept',
    method: 'post',
    data: data
  })
}

// 修改部门
export function updateDept(data) {
  return request({
    url: '/system/dept',
    method: 'put',
    data: data
  })
}

// 删除部门
export function delDept(data) {
  return request({
    url: '/system/dept/delDept' ,
    method: 'post',
    data: data
  })
}

// 下移
export function downDept(query) {
  return request({
    url: '/system/dept/downDept',
    method: 'post',
    data: query
  })
}

// 上移
export function upDept(query) {
  return request({
    url: '/system/dept/upDept',
    method: 'post',
    data: query
  })
}

export function Get_Info(query) {
  return request({
    url: '/system/dept/get_info',
    method: 'post',
    data: query
  })
}

export function refreshCache(query) {
  return request({
    url: '/system/dept/refreshcache',
    method: 'post',
    data: query
  })
}

export function listDeptUser(query) {
  return request({
    url: '/system/dept/listDeptUser',
    method: 'post',
    data: query
  })
}
